package java_DesignPattern.CreatorPattern.SingletonPattern.lazy.method1;

/**
 * 测试单例设计模式-懒汉式:方式1(线程安全)
 */
public class TestSafe {

    public static void main(String[] args) {
        SingletonSafe instanceSafe = SingletonSafe.getInstanceSafe();
        SingletonSafe instanceSafe1 = SingletonSafe.getInstanceSafe();

        //验证是否是同一个实例
        System.out.println(instanceSafe == instanceSafe1);
    }
}
